package com.sanji.sjmallmodule.account;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sanji.sjmallapp.BaseActivity;
import com.sanji.sjmallapp.R;
import com.sanji.sjmallwidget.XListView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/****
 * 售后列表
 ***/
public class SaleAfterActivity extends BaseActivity implements View.OnClickListener, XListView.IXListViewListener {

    @BindView(R.id.common_back_img)
    ImageView commonBackImg;
    @BindView(R.id.common_left_tv)
    TextView commonLeftTv;
    @BindView(R.id.sale_after_list)
    XListView saleAfterList;
    private SaleAfterAdapter adapter;
    private List<SaleAfterBean> mData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sale_after);
        ButterKnife.bind(this);
        initView();
    }

    public void initView() {
        commonLeftTv.setText(getString(R.string.sale_after));
        mData = new ArrayList<>();
        //模拟数据
//        mData.add(new SaleAfterBean("201512224171522790", "2016-09-18 18:20:51", "7197", "维修", "20160617100059339", "￥" + "0.00", 0));
//        mData.add(new SaleAfterBean("201512224171522791", "2016-09-18 18:20:51", "7197", "30天退换货", "20160617100059666", "￥" + "0.00", 1));
        commonBackImg.setOnClickListener(this);
        adapter = new SaleAfterAdapter(mData, this);
        saleAfterList.setAdapter(adapter);
        saleAfterList.setPullLoadEnable(false);
        saleAfterList.setXListViewListener(this);
        saleAfterList.setHeaderDividersEnabled(false);
        saleAfterList.setFooterDividersEnabled(false);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.common_back_img:
                finish();
                break;
        }
    }

    @Override
    public void onRefresh() {

    }

    @Override
    public void onLoadMore() {

    }

}
